/**
 * Created by mayousheng on 2016/11/21.
 *
 * 单页面主动跳转调用
 *
 * @param query object
 * @param hash string
 * @param state object
 *
 * command:
 *  this.context.router.push(createLocationDescriptor('/app/test'))
 */
export function createLocationDescriptor(to, { query='', hash='', state='' } = {}){
    if (query || hash || state) {
        return { pathname: to, query, hash, state }
    }

    return to
}